# Contributor: Martijn Braam <martijn@brixit.nl>
# Maintainer: Martijn Braam <martijn@brixit.nl>
pkgname=libdng
pkgver=0.1.1
pkgrel=1
pkgdesc="Interface library between libtiff and the world to make sure the output is valid DNG"
url="https://gitlab.com/megapixels-org/libdng"
arch="all !s390x" # Libtiff does weird things on s390x
license="MIT"
source="https://gitlab.com/megapixels-org/libdng/-/archive/$pkgver/libdng-$pkgver.tar.gz
	libtiff.patch
	"
makedepends="cmake linux-headers meson tiff-dev scdoc"
subpackages="$pkgname-doc $pkgname-dev $pkgname-utils"

build() {
	abuild-meson . output
	meson compile -C output
}

check() {
	meson test --no-rebuild -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

utils() {
	pkgdesc="DNG manipulation utlities using libdng"
	amove usr/bin
}


sha512sums="
e8f8f0d78ff89fc50e2fde1787d528946c171b43b1056eecd645904f93ac57e52a516361667628a1457783169703649a7aebd496c054cd38751f9de21e84be1d  libdng-0.1.1.tar.gz
eff305e2d67a4074a3f4e7ccb7b3285ca4445bca68c6f829c7a884654a35bc959bef1f20ee8580aa01de9d2cedf1405ab5e90fa416122bd44365a70e187d2ed1  libtiff.patch
"
